package com.zp.self;

import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author By ZengPeng
 * @Description
 * @date in  2021/3/25 23:58
 * @Modified By
 */
@Service
public class NacosService {
    @Resource
    RestTemplate restTemplate;

    public  Object rpcRequest(String name){
        String forObject = restTemplate.getForObject("http://test/hi?name=" + name, String.class);
        System.out.println("调用完成："+forObject);
        return forObject;
    }
}
